import { ref } from "vue";

interface User {
 email : number | null;
  password: string;
}

export const loginUser = ref<User>({
  email: null,
  password: "",
})


export const rules = ref({
  email: [
    {
      required: true,
      validator: "email",
      message: "邮箱不能为空哦",
      trigger: "blur",
    },
    { type:"email", message: "请输入正确的邮箱", trigger: ['blur', 'change'] },
  ],
  password: [
    { required: true, message: "密码不能为空哦~", trigger: "blur" },
    { min: 6, max: 20, message: "密码长度需要在在6-20位", trigger: "blur" },
  ],
});